

CC := E:/programfiles/devkitPro/devkitARM_r45-win32/devkitARM/bin/arm-none-eabi-gcc
TEXT_START := 0x09000000


ASM_SRC := $(shell E:/msys2/usr/bin/find -name *.s)
SRC := $(shell E:/msys2/usr/bin/find -name *.c)

OBJS = $(patsubst %.s, %.o, $(ASM_SRC)) \
	$(patsubst %.c, %.o, $(SRC))

hack.elf:$(OBJS)
	$(CC) -mthumb -nostdlib -fno-builtin $(OBJS) -o $(@) -Wl,-Ttext,$(TEXT_START)

clean:
	-rm hack.elf
	-rm $(OBJS)

%.o:%.c
	$(CC) -mthumb -nostdlib -c $(<) -o $(@)

%.o:%.s
	$(CC) -mthumb -nostdlib -c $(<) -o $(@)



